<?php
	require '../include/library.inc.php';
	require '../include/admin_login.inc.php';

$user_id = intval(($_GET['user_id'])?$_GET['user_id']:$_POST['user_id']);
if (!$user_id) redirect("users.php");
	
$sql = 'SELECT
			*
		FROM
			users
		WHERE
			user_id = '.$user_id.'
	';
$row_user = mysql_fetch_assoc(query($sql));



head_admin("User Edit");
?>
		
		<?php if ($error_message) { ?>
		  <div class="message red">
			<h4>Error!</h4>
			<?=$error_message?>
		  </div>
		<?php } ?>
		
		
		
            <div class="topbuttons">
            	<a href="users.php">Back to users</a>
            </div>
            
            <h2>User information</h2>
            
            Fisrt Name, Last Name:<br>
            <h3><?=$row_user['first_name']?> <?=$row_user['last_name']?></h3>
            
            <?=($row_user['married']==1)?"Married":"Single"?> <?=($row_user['gender']=='m')?"Male":"Female"?> from
            
            <?php
			$sql = "SELECT
						name
					FROM
						countries
					WHERE
						country_id = '".$row_user['hometown_country_id']."'
					  ";
			$res_country = mysql_fetch_assoc(query($sql));
			
			echo $res_country['name'];
			?>
            <br>
            Date Of Birth: <?=date('Y/m/d',strtotime($row_user['date_of_birth']))?>,
            Phone Number: <?=$row_user['phone']?>
            
            <br><br>
            
            <h2>Contact Information</h2><br>
            
            <b>Street Address</b> <?=$row_user['street_address']?><br>
            
            <b>City</b> <?=$row_user['city']?><br>
            
            <b>State</b> <?=$row_user['state']?><br>
            
            <b>Zip Code</b> <?=$row_user['zipcode']?><br>
            
            <b>Country</b>
            <?php
			$sql = "SELECT
						name
					FROM
						countries
					WHERE
						country_id = '".$row_user['country_id']."'
					  ";
			$res_country = mysql_fetch_assoc(query($sql));
			
			echo $res_country['name'];
			?><br><br>
            
            <b>Emergency Contact</b> <?=$row_user['emergency_contact']?>
            
            <br><br>
            
            <h2>Educational Background</h2><br>
            
            <b>Have you graduated from high school?</b><br>
			<small>Enter School Name and Year</small><br>
            <?=$row_user['high_school_name']?>,
            <?=$row_user['high_school_date']?>
            
            <br><br>

            <b>Have you graduated from college or university? </b><br>
			<small>Enter School Name and Year</small><br>
            <?=$row_user['university_name']?>,
			<?=$row_user['university_date']?>
            
            <br><br>
            <b>English Level</b><br>
                <input type="checkbox" disabled <?=($row_user['english_level']==1)?"checked":""?> >
                Beginner
                <input type="checkbox" disabled <?=($row_user['english_level']==2)?"checked":""?> >
                Elementary
                <input type="checkbox" disabled <?=($row_user['english_level']==3)?"checked":""?> >
                Low Intermediate
                <input type="checkbox" disabled <?=($row_user['english_level']==4)?"checked":""?> >
                High Intermediate
                <input type="checkbox" disabled <?=($row_user['english_level']==5)?"checked":""?> >
                Advanced
                
            <br><br>
            
            <b>Have you taken the TOEFL within the past 2 years?</b><br>
            <small>Enter Test Date and Score</small><br>
			<?=$row_user['toefl']?>
            
            <br><br>

            <b>What are your plans after completing this course?</b><br>
                <input type="checkbox" disabled <?=($row_user['future_plans']==1)?"checked":""?> >
                Study at University or College
                <input type="checkbox" disabled <?=($row_user['future_plans']==2)?"checked":""?> >
                Return to my country
                <input type="checkbox" disabled <?=($row_user['future_plans']==3)?"checked":""?> >
                Undecided
                <input type="checkbox" disabled <?=($row_user['future_plans']==4)?"checked":""?> >
                Other
                        
            <br><br>
            
            <b>Who will financially support your study abroad?</b><br>
                <input type="checkbox" disabled <?=($row_user['finances']==1)?"checked":""?> >
                Self-funded
                <input type="checkbox" disabled <?=($row_user['finances']==2)?"checked":""?> >
                Family
                <input type="checkbox" disabled <?=($row_user['finances']==3)?"checked":""?> >
                Company
                <input type="checkbox" disabled <?=($row_user['finances']==4)?"checked":""?> >
                School
                <input type="checkbox" disabled <?=($row_user['finances']==5)?"checked":""?> >
                Scholarship
                <input type="checkbox" disabled <?=($row_user['finances']==6)?"checked":""?> >
                Other
            
            <br><br>
                        
            <h2>Visa Information</h2><br>
            
            <table class="application" width="100%">
            <tr><td colspan="2" >
            
            <b>Are you currently in the U.S.?</b><br>
            <label>
            <input type="radio" disabled <?=($row_user['in_us']==1)?"checked":""?> >
            Yes</label>
            <label>
            <input type="radio" disabled <?=($row_user['in_us']==0)?"checked":""?> >
            No</label>
            
            </td></tr>
            
            <tr><td width="50%">
            <br>
            <b>Do you currently have a visa?</b><br>
              <label>
                <input type="radio" disabled <?=($row_user['have_visa']==1)?"checked":""?> >
                Yes</label>
              <label>
                <input type="radio" disabled <?=($row_user['have_visa']==0)?"checked":""?> >
                No</label>
            
            </td><td>
            
            <b>What is your visa / immigration status?</b><br>
            <?=$row_user['visa_type']?>
            
            </td></tr>
            
            <tr><td colspan="2">
            <b>Are you currently attending school in the U.S.?</b><br>
              <label>
                <input type="radio" disabled <?=($row_user['attending_school']==1)?"checked":""?> >
                Yes</label>
              <label>
                <input type="radio" disabled <?=($row_user['attending_school']==0)?"checked":""?> >
                No</label>
            
            </td></tr>
            
            <tr><td>
            <br>
            <b>Name of institution issued your I-20?</b><br>
            <?=$row_user['i20_institution']?>
            
            </td><td>
            <br>
            <b>SEVIS ID number of your current I-20?</b><br>
            <?=$row_user['i20_id']?>
            
            </td></tr>
            
            </table>
            <br><br>
                                   
            
            
<?php
	foot_admin(); 
?>